﻿
using Foothill.Common;
using NUnit.Framework;

namespace Foothill.Model.Test
{
    [TestFixture]
    public class AddListingTypeFilterItemTest
    {
        [Test]
        public void ListingTypeShouldBeSetToBoth_WhenRemovingOwnerFromOwner()
        {
            ForSaleAdAdvancedSearchParameter param = new ForSaleAdAdvancedSearchParameter { ListingTypeId = (int)ListingTypes.Owner };

            AdCategorySelectItem newItem = new AdCategorySelectItem() { Category = AdListCategory.ListingType, Action = SelectItemAction.Remove, SelectedIdValue = (int)ListingTypes.Owner };
            param.AddFilterItem(newItem);

            Assert.AreEqual((int)ListingTypes.Both, param.ListingTypeId);
        }
    }
}
